package org.lightrpc;

import java.util.ArrayList;
import java.util.Collection;

import org.lightrpc.server.LightRpcWebService;


@LightRpcWebService
public class DummyService implements IDummyService{
	
	public Collection<Dummy> test(String jotain){
		System.out.println("Method called");
		ArrayList<Dummy> list = new ArrayList<Dummy>();
		Dummy dumy = new Dummy();
		dumy.setTestInt(123);
		dumy.setTestString("This is DATA!!!");
		Dummy dumy2 = new Dummy();
		dumy2.setTestInt(222);
		dumy2.setTestString("This is DATA, AGAIN!!!");
		list.add(dumy);
		list.add(dumy2);
		return list;
	}
	
	public Dummy test(){
		Dummy dumy = new Dummy();
		dumy.setTestInt(999);
		dumy.setTestString("jotain DATA!!!");
		return dumy;
	}

	@Override
	public Dummy test(String one, Integer two) {
		return new Dummy(one, two);
	}

	@Override
	public Dummy willThrowError(String nonsense) throws DummyException {
		throw new DummyException(nonsense);
	}
}
